package com.yuan.algorithms.arithmetic_1;

import java.util.Scanner;

public class 递归_N个布尔量的所有组合 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()) {
			int n = sc.nextInt();
			int[] b = new int[n];
			coding(b, n-1);
		}
	}

	public static void coding(int[] b, int n) {
		if (n==0) {
			b[n] = 0;
			outBn(b);
			b[n] = 1;
			outBn(b);
		}else {
			b[n] = 0;
			coding(b, n-1);
			b[n] = 1;
			coding(b, n-1);
		}
	}

	private static void outBn(int[] b) {
		for (int i = 0; i < b.length; i++) {
			System.out.print(b[i]);
		}
		System.out.println();
	}
}
